package com.ken.algorithms.tree;

import com.ken.algorithms.enums.NodeColor;

/**
 * <ul>
 * <li>Title: RedBlackTree</li>
 * <li>Description: TODO </li>
 * </ul>
 *
 * @author swc
 * @date 2021-09-23 10:02
 */
public class RedBlackTree {

    private NodeColor color;

    private int val;

    private RedBlackTree left;

    private RedBlackTree right;

    public RedBlackTree(int val) {
        this.color = NodeColor.Black;//默认是黑色
        this.val =val;
        this.left =null;
        this.right =null;
    }

    public NodeColor getColor() {
        return color;
    }

    public void setColor(NodeColor color) {
        this.color = color;
    }

    public int getVal() {
        return val;
    }

    public void setVal(int val) {
        this.val = val;
    }

    public RedBlackTree getLeft() {
        return left;
    }

    public void setLeft(RedBlackTree left) {
        this.left = left;
    }

    public RedBlackTree getRight() {
        return right;
    }

    public void setRight(RedBlackTree right) {
        this.right = right;
    }
}
